home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
cuj1008.zip
/
1008129A
< prev
next >
Wrap
Text File
|
1992-06-09
|
887b
|
31 lines
#include <stdio.h>
struct s_node
{
struct s_node *next_node;
char *string_value;
};
void main()
{
/* Let's just do static initialization for now */
static struct s_node fourth_node = { NULL, "Four"};
static struct s_node third_node = {&fourth_node, "Three"};
static struct s_node second_node = {&third_node, "Second"};
static struct s_node first_node = {&second_node, "First"};
static struct s_node *root_node = &first_node;
static struct s_node *current_node = NULL;
int counter;
/* Get to the third node */
current_node = root_node;
for (counter = 0; counter < 2; counter ++)
{
current_node = current_node->next_node;
}
printf("Third string value is %s",
current_node->string_value);
}